/**
  err.c - Created by Timothy Morey on 7/17/2012
 */

#include <stdio.h>
#include <string.h>

#include "err.h"
#include "logger.h"

#ifdef __WINDOWS__
#pragma warning(disable:4996)
#endif

int WriteErrorMessage(int err, const char* msg)
{
  int retval = NVN_NOERR;
  char logmsg[1024];

  sprintf(logmsg, "[errorcode=%d: %s] %s", err, g_ErrMsg[err], msg);
  WriteMessage(LogLevelError, logmsg);

  return retval;
}
